home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 …ember: Reference Library / Dev.CD Dec 00 RL Disk 1.toast / pc / technical documentation / develop / develop issue 26 / develop issue 26 code / truffles - display mgr. / sprocket / interfaces / dialogwindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-02  |  1.7 KB  |  76 lines

  1. /*
  2.     File:        DialogWindow.h
  3.  
  4.     Contains:    Interfaces of a base class for Modeless Dialogs
  5.                 
  6.     Written by: Dave Falkenburg
  7.  
  8.     Copyright:    © 1993-1995 by Dave Falkenburg, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.     
  12.          <4>     1/20/95    DRF        Adapt to new Menu handling methodology. Also protected the
  13.                                     constructor, as this is really an abstract class.
  14.          <3>     11/8/94    DRF        We have better menu handling methods, so use them instead of the
  15.                                     old “DoEditMenu” method.
  16.          <2>     10/17/94    DRF        Made ItemHit a pure virtual method.
  17.  */
  18.  
  19. #ifndef        _DIALOGWINDOW_
  20. #define        _DIALOGWINDOW_
  21.  
  22. #ifndef        _WINDOW_
  23. #include    "Window.h"
  24. #endif
  25.  
  26. #ifndef        __DIALOGS__
  27. #include    <Dialogs.h>
  28. #endif
  29.  
  30. typedef    short    DialogTemplateID;
  31. typedef    short    DialogItemID;
  32.  
  33.     
  34.  
  35. class    TDialogWindow    :    public    TWindow
  36.     {
  37. private:
  38.     DialogTemplateID    fTemplateID;
  39.     
  40. protected:
  41.  
  42.     //    types of dialogs that we can create
  43.  
  44.     enum    DialogType
  45.         {
  46.         kModalDialog = 0,
  47.         kModelessDialog
  48.         };
  49.         
  50.     //    Protect the constructor, because this is an abstract class
  51.  
  52.                         TDialogWindow(DialogType dialogType, DialogTemplateID theDialogTemplate);
  53.  
  54. public:
  55.     virtual    Boolean        EventFilter(EventRecord *theEvent);
  56.     virtual    Boolean        FilterDialogEvent(EventRecord *theEvent, short *itemHit );
  57.  
  58.     virtual WindowRef    MakeNewWindow(WindowRef behindWindow);
  59.     virtual    Boolean        Close(void);
  60.  
  61.     virtual void        Activate(Boolean activating);
  62.     virtual void        Draw(void);
  63.     virtual void        Click(EventRecord *anEvent);
  64.  
  65.     virtual    void        AdjustMenusBeforeMenuSelection(void);
  66.     virtual Boolean        DoMenuCommand(MenuCommandID command);
  67.     
  68. //    New methods that MUST be overridden:
  69.  
  70.     virtual    void        ItemHit(short theItem) = 0;
  71.     
  72.     inline DialogRef    GetDialogRef(void)    { return (DialogRef) fWindow; }
  73.     };
  74.  
  75. #endif
  76.